<div id="centre-mosaic-page-form">
    <form action="" method="POST" enctype="multipart/form-data">
        <input type="hidden" name="id"/>
        <div class="form-group row">
            <label class="col-sm-4 col-md-3 control-label form-control-static text-right">标题</label>
            <div class="col-sm-8 col-md-6">
                <input type="text" name="name" class="form-control"/>
            </div>
            <div class="col-sm-8 col-md-3 col-sm-offset-4 col-md-offset-0 help-block text-error form-control-static"></div>
            <div class="col-sm-8 col-md-6 col-sm-offset-4 col-md-offset-3 help-block text-muted form-control-static"></div>
        </div>
        <div class="form-group row">
            <label class="col-sm-4 col-md-3 control-label form-control-static text-right">简介</label>
            <div class="col-sm-8 col-md-6">
                <textarea name="note" class="form-control"/>
            </div>
            <div class="col-sm-8 col-md-3 col-sm-offset-4 col-md-offset-0 help-block text-error form-control-static"></div>
            <div class="col-sm-8 col-md-6 col-sm-offset-4 col-md-offset-3 help-block text-muted form-control-static"></div>
        </div>
        <div class="form-group row">
            <label class="col-sm-4 col-md-3 control-label form-control-static text-right">标签</label>
            <div class="col-sm-8 col-md-6">
                <input type="text" name="name" class="form-control" data-toggle="tagsinput"/>
            </div>
            <div class="col-sm-8 col-md-3 col-sm-offset-4 col-md-offset-0 help-block text-error form-control-static"></div>
            <div class="col-sm-8 col-md-6 col-sm-offset-4 col-md-offset-3 help-block text-muted form-control-static"></div>
        </div>
        <div class="form-group row">
            <label class="col-sm-4 col-md-3 control-label form-control-static text-right">图标</label>
            <div class="col-sm-8 col-md-6">
                <input type="file" name="logo" class="form-ignored invisible"/>
                <ul class="pickbox" data-fn="logo" data-ft="_view" data-keep="keep" data-size="300*300"></ul>
                <button type="button" class="btn btn-default form-control" data-toggle="hsView">浏览...</button>
            </div>
            <div class="col-sm-8 col-md-3 col-sm-offset-4 col-md-offset-0 help-block text-error form-control-static"></div>
            <div class="col-sm-8 col-md-6 col-sm-offset-4 col-md-offset-3 help-block text-muted form-control-static"></div>
        </div>
        <div class="form-group row">
            <label class="col-sm-4 col-md-3 control-label form-control-static text-right">类型</label>
            <div class="col-sm-8 col-md-6">
                <select name="type" class="form-control">
                    <option value="">--请选择--</option>
                </select>
            </div>
            <div class="col-sm-8 col-md-3 col-sm-offset-4 col-md-offset-0 help-block text-error form-control-static"></div>
            <div class="col-sm-8 col-md-6 col-sm-offset-4 col-md-offset-3 help-block text-muted form-control-static"></div>
        </div>
        <div class="form-group row">
            <label class="col-sm-4 col-md-3 control-label form-control-static text-right">链接</label>
            <div class="col-sm-8 col-md-6">
                <input type="url" name="link" class="form-control"/>
            </div>
            <div class="col-sm-8 col-md-3 col-sm-offset-4 col-md-offset-0 help-block text-error form-control-static"></div>
            <div class="col-sm-8 col-md-6 col-sm-offset-4 col-md-offset-3 help-block text-muted form-control-static"></div>
        </div>
        <div class="form-group row">
            <label class="col-xs-4 col-md-3 control-label form-control-static text-right">内容</label>
            <div class="col-md-8 col-md-offset-2">
                <textarea name="html" data-type="html" style="width:100%; height:15em; border:0;"></textarea>
            </div>
            <div class="col-xs-8 col-md-6 col-xs-offset-4 col-md-offset-3 help-block text-error form-control-static"></div>
            <div class="col-xs-8 col-md-6 col-xs-offset-4 col-md-offset-3 help-block text-muted form-control-static"></div>
        </div>
        <hr/>
        <div class="row">
            <div class="col-sm-8 col-md-6 col-sm-offset-4 col-md-offset-3">
                <button type="submit" class="commit btn btn-primary">提交</button>
                <button type="button" class="cancel btn btn-link"   >取消</button>
            </div>
        </div>
        <br/>
    </form>
</div>
<script type="text/javascript">
(function($) {
    var context = H$("#centre-mosaic-page-form");
    var loadbox = context.closest(".loadbox");
    var formbox = context.find("form");
    var formobj ;

    if (H$("&id", loadbox)) {
        formobj = context.hsForm({
               _url : "centre/site/0/page/search.act?ab=.enfo",
            saveUrl : "centre/site/0/page/update.act"
        });
    } else {
        formobj = context.hsForm({
               _url : "centre/site/0/page/select.act?ab=.enfo",
            saveUrl : "centre/site/0/page/create.act"
        });
    }
    
    // 特殊控件
    formobj._fill__view = hsFormFillView;
    setFormItems( formbox , loadbox);
    
    // 加载数据
    formobj.load(undefined, loadbox);
})(jQuery);
</script>